home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / tools / gcc / libnixv1_0.lha / gnu / libnix-sources.lha / sources / makefile < prev   
Encoding:
Makefile  |  1995-04-19  |  2.3 KB  |  77 lines

  1. # Built one model of the libnix libraries - use
  2. # make CFLAGS="what you like" to built them.
  3. #
  4. # Combine
  5. #
  6. # CFLAGS=-Wall -O3 -DOS_20_ONLY
  7. #
  8. #   -fbaserel -DSMALL_DATA    for small data model
  9. #   -mc68020            for 68020 specific code
  10. #   -mc68881            for 68881 specific code
  11. #   -DIXPATHS            for Un*x path option
  12. #   -DDEBUG_LIB            build a library for debugging (not recommended)
  13. #   -DOS_20_ONLY        disable some 1.3 compatibilities (use always)
  14.  
  15. SOURCEDIR=../sources
  16.  
  17. MAKELIST=make -f ../makefile filelist
  18.  
  19. SUBDIRS=nixmain nix_main misc nix math stubs
  20.  
  21. all: $(SUBDIRS)
  22.     for subdir in $(SUBDIRS); do \
  23.     ( cd $$subdir;make -f ../$(SOURCEDIR)/$$subdir/makefile V="$(V)" \
  24.       CFLAGS="$(CFLAGS)" ); \
  25.     done
  26.  
  27. $(SUBDIRS):
  28.     mkdir $@
  29.  
  30. libamiga: amiga
  31.     cd amiga;make -f ../$(SOURCEDIR)/amiga/makefile CFLAGS="$(CFLAGS)"
  32.  
  33. filelists:
  34.     -cd math;    $(MAKELIST) SOURCEFILES="*/*"
  35.     -cd nix;    $(MAKELIST) SOURCEFILES="*/*"
  36.     -cd stubs;    make -f ../makefile libbases/dos.c; \
  37.         $(MAKELIST) SOURCEFILES=" \
  38.         libbases/* misc/__DOSBase.c misc/__UtilityBase.c \
  39.         misc/__MathIeeeSingBasBase.c misc/__MathIeeeDoubBasBase.c \
  40.         misc/__MathIeeeSingTransBase.c misc/__MathIeeeDoubTransBase.c \
  41.         misc/__initlibraries.c libnames/* stubs/*"
  42.     -cd amiga;    $(MAKELIST) SOURCEFILES="*/*"
  43.  
  44. filelist:
  45.     echo "#Computer generated partial makefile-do not edit" >filelist
  46.     echo "OBJECTS= \\" >>filelist
  47.     ( for file in $(SOURCEFILES); do echo $$file; done ) | \
  48.     gawk '{ print substr($$0,1,length($$0)-2) ".o \\" }' >>filelist
  49.     echo >>filelist
  50.     echo "SUBDIRS= \\" >>filelist
  51.     ls -d -F *|gawk '/\// { print substr($$0,1,length($$0)-1) " \\" }' >>filelist
  52.  
  53. # build stubs for library base pointers
  54. libbases/dos.c: ../makefile library.list
  55.     -rm libbases/* libnames/*
  56.     gawk <library.list '{ sname=substr($$2,1,length($$2)-8);    \
  57.       fname="libbases/" sname ".c";                    \
  58.       print "/* Machine-generated C-file- do not edit ! */"    >fname;    \
  59.       print "#include <stabs.h>"                >fname;    \
  60.       print "extern char __" sname "name[];"        >fname;    \
  61.       print "void *" $$1 "[2]={ 0l,__" sname "name };"    >fname;    \
  62.       print "ADD2LIB(" $$1 ");"                >fname;    \
  63.       fname="libnames/" sname ".c";                    \
  64.       print "/* Machine-generated C-file- do not edit ! */"    >fname;    \
  65.       print "char __" sname "name[]=\"" $$2 "\";"        >fname;}'
  66.     
  67. clean:
  68.     cd nixmain;    make clean
  69.     cd nix_main;    make clean
  70.     cd misc;    make clean
  71.     cd math;    make clean
  72.     cd nix;        make clean
  73.     cd stubs;    make clean
  74.  
  75. veryclean:
  76.     -rm -r *
  77.